import request from '@/utils/request'
import { BASE_URL } from '@/api/constant'

export function login(data) {
  return request({
    url: BASE_URL + '/auth/login',
    method: 'POST',
    data
  })
}

export function getInfo() {
  return request({
    url: BASE_URL + '/user/getCurrentUserInfo',
    method: 'POST'
  })
}

export function logout() {
  return request({
    url: BASE_URL + '/auth/logout',
    method: 'POST'
  })
}

export function resetPassword(data) {
  return request({
    url: BASE_URL + '/user/resetPassword',
    method: 'POST',
    data
  })
}

export function getUserList(data) {
  return request({
    url: BASE_URL + '/user/list',
    method: 'POST',
    data
  })
}

export function addUser(data) {
  return request({
    url: BASE_URL + '/user/add',
    method: 'POST',
    data
  })
}

export function deleteUser(data) {
  return request({
    url: BASE_URL + '/user/delete',
    method: 'POST',
    data
  })
}
